package com.xdtech.transportation.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.transportation.model.TranOrder;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-03-17 11:12:47
 * @since 1.0
 * @see
 */
public class TranOrderItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="订单编号",width=100)
	private String orderNo;
	@GridColumn(title="目的地",width=100)
	private String endPlace;
	@GridColumn(title="出发地",width=100)
	private String startPlace;
	@GridColumn(title="收货人",width=100)
	private String consignee;
	@GridColumn(title="联系电话",width=100)
	private String contactNum;

	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	
	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}
	public String getOrderNo() {
		return orderNo;
	}
	
	public void setEndPlace(String endPlace) {
		this.endPlace = endPlace;
	}
	public String getEndPlace() {
		return endPlace;
	}
	
	public void setStartPlace(String startPlace) {
		this.startPlace = startPlace;
	}
	public String getStartPlace() {
		return startPlace;
	}
	
	public void setConsignee(String consignee) {
		this.consignee = consignee;
	}
	public String getConsignee() {
		return consignee;
	}
	
	public void setContactNum(String contactNum) {
		this.contactNum = contactNum;
	}
	public String getContactNum() {
		return contactNum;
	}
	
	/**
	 * 鏍规嵁model鏋勫缓vo
	 * 
	 * @author max
	 * @return
	 */
	public static TranOrderItem createItem(TranOrder tranOrder) {
		TranOrderItem tranOrderItem = new TranOrderItem();
		BeanUtils.copyProperties(tranOrderItem, tranOrder);
		//鑷畾涔夊睘鎬ц缃～鍏�
		return tranOrderItem;
	}
	/**
	 * 鏍规嵁model闆嗗悎鍒涘缓vo闆嗗悎
	 * 
	 * @author max
	 * @return
	 */
	public static List<TranOrderItem> createItems(List<TranOrder> tranOrders) {
		List<TranOrderItem> tranOrderItems = new ArrayList<TranOrderItem>();
		for (TranOrder tranOrder : tranOrders) {
			tranOrderItems.add(createItem(tranOrder));
		}
		return tranOrderItems;
	}
}
